//
//  IntroduceViewController.m
//  Memo
//
//  Created by A-01 on 2020/7/8.
//  Copyright © 2020 A-01. All rights reserved.
//

#import "IntroduceViewController.h"

@interface IntroduceViewController ()

@property (nonatomic, weak)UIImageView * textImageView;
@property (nonatomic, weak)UILabel * introLabel;

@end

@implementation IntroduceViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    self.titleLabel.text = @"Introduction";
    [self setupUI];
}


- (void)setupUI{
    
    UIImageView * textImageView = [UIImageView new];
    
    textImageView.image = [UIImage imageNamed:@"intro"];
    
    self.textImageView = textImageView;
    
    [self.view addSubview:self.textImageView];
    
    
    UILabel * introLabel = [UILabel new];
    
    introLabel.text = @"Wish Memo is an app that records your wishes.\nThe app willnot connected with internet,so don't worry about your wish being discovered.Different colors on the wall of the wish represent different states of hope.\nWrite your wishes on the wall of your wish";
    introLabel.textColor = ZRBlackColor;
    introLabel.font = [UIFont systemFontOfSize:16];
    introLabel.numberOfLines = 0;
    
    self.introLabel = introLabel;
    
    [self.textImageView addSubview:self.introLabel];
}


-(void)viewDidLayoutSubviews{
    
    [super viewDidLayoutSubviews];
    
    [self.textImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.mas_equalTo(self.view).offset(40);
        make.trailing.mas_equalTo(self.view).offset(-40);
        make.top.mas_equalTo(self.titleLabel.mas_bottom).offset(40);
        make.height.mas_equalTo((kScreenW - 80) * 1.5);
    }];
    
    [self.introLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(self.textImageView).offset(-30);
        make.leading.mas_equalTo(self.textImageView).offset(30);
        make.trailing.mas_equalTo(self.textImageView).offset(-30);
    }];
}

@end
